package com.example.model;

import java.io.File;

public class Movie {
    public String imdbid;
    public String name;
    public String aka;
    public String year;
    public String duration;
    public String rating;
    public String format;
    public boolean own;
    public boolean seen;
    public boolean loaned;
    public String loanname;
    public String loandate;
    public File cover;
    public String trailer;
    public String notes;
    public String taglines;
    public String plotoutline;
    public String plots;
    public String text_languages;
    public String subtitles;
    public String audio;
    public String video;
    public String country;
    public String genres;
    public String director;
    public String writer;
    public String producer;
    public String music;
    public String cast;

    public static Movie createValidMovie() {
        Movie movie = new Movie()
            .withImdbid("123")
            .withName("The Shawshank Redemption")
            .withAka("Побег из Шоушенка")
            .withYear("1994")
            .withDuration("142")
            .withRating("9.3")
            .withOwn(true)
            .withSeen(false)
            .withLoaned(true)
            .withLoanname("2013-01-27")
            .withLoandate("2013-01-27")
            .withCover(new File("images/123.jpg"))
            .withNotes("111")
            .withTaglines("222")
            .withPlotoutline("333")
            .withPlots("444")
            .withTextLanguages("555")
            .withSubtitles("666")
            .withAudio("777")
            .withVideo("888")
            .withCountry("999")
            .withGenres("999")
            .withDirector("000")
            .withWriter("001")
            .withProducer("002")
            .withMusic("003")
            .withCast("004");
        return movie;
    }

    public Movie withImdbid(String imdbid) {
        this.imdbid = imdbid;
        return this;
    }

    public Movie withName(String name) {
        this.name = name;
        return this;
    }

    public Movie withAka(String aka) {
        this.aka = aka;
        return this;
    }

    public Movie withYear(String year) {
        this.year = year;
        return this;
    }

    public Movie withDuration(String duration) {
        this.duration = duration;
        return this;
    }

    public Movie withRating(String rating) {
        this.rating = rating;
        return this;
    }

    public Movie withFormat(String format) {
        this.format = format;
        return this;
    }

    public Movie withOwn(boolean own) {
        this.own = own;
        return this;
    }

    public Movie withSeen(boolean seen) {
        this.seen = seen;
        return this;
    }

    public Movie withLoaned(boolean loaned) {
        this.loaned = loaned;
        return this;
    }

    public Movie withLoanname(String loanname) {
        this.loanname = loanname;
        return this;
    }

    public Movie withLoandate(String loandate) {
        this.loandate = loandate;
        return this;
    }

    public Movie withCover(File cover) {
        this.cover = cover;
        return this;
    }

    public Movie withTrailer(String trailer) {
        this.trailer = trailer;
        return this;
    }

    public Movie withNotes(String notes) {
        this.notes = notes;
        return this;
    }

    public Movie withTaglines(String taglines) {
        this.taglines = taglines;
        return this;
    }

    public Movie withPlotoutline(String plotoutline) {
        this.plotoutline = plotoutline;
        return this;
    }

    public Movie withPlots(String plots) {
        this.plots = plots;
        return this;
    }

    public Movie withTextLanguages(String text_languages) {
        this.text_languages = text_languages;
        return this;
    }

    public Movie withSubtitles(String subtitles) {
        this.subtitles = subtitles;
        return this;
    }

    public Movie withAudio(String audio) {
        this.audio = audio;
        return this;
    }

    public Movie withVideo(String video) {
        this.video = video;
        return this;
    }

    public Movie withCountry(String country) {
        this.country = country;
        return this;
    }

    public Movie withGenres(String genres) {
        this.genres = genres;
        return this;
    }

    public Movie withDirector(String director) {
        this.director = director;
        return this;
    }

    public Movie withWriter(String writer) {
        this.writer = writer;
        return this;
    }

    public Movie withProducer(String producer) {
        this.producer = producer;
        return this;
    }

    public Movie withMusic(String music) {
        this.music = music;
        return this;
    }

    public Movie withCast(String cast) {
        this.cast = cast;
        return this;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Movie movie = (Movie) o;

        if (loaned != movie.loaned) return false;
        if (own != movie.own) return false;
        if (seen != movie.seen) return false;
        if (aka != null ? !aka.equals(movie.aka) : movie.aka != null) return false;
        if (audio != null ? !audio.equals(movie.audio) : movie.audio != null) return false;
        if (cast != null ? !cast.equals(movie.cast) : movie.cast != null) return false;
        if (country != null ? !country.equals(movie.country) : movie.country != null) return false;
        if (cover != null ? !cover.equals(movie.cover) : movie.cover != null) return false;
        if (director != null ? !director.equals(movie.director) : movie.director != null) return false;
        if (duration != null ? !duration.equals(movie.duration) : movie.duration != null) return false;
        if (format != null ? !format.equals(movie.format) : movie.format != null) return false;
        if (genres != null ? !genres.equals(movie.genres) : movie.genres != null) return false;
        if (imdbid != null ? !imdbid.equals(movie.imdbid) : movie.imdbid != null) return false;
        if (loandate != null ? !loandate.equals(movie.loandate) : movie.loandate != null) return false;
        if (loanname != null ? !loanname.equals(movie.loanname) : movie.loanname != null) return false;
        if (music != null ? !music.equals(movie.music) : movie.music != null) return false;
        if (!name.equals(movie.name)) return false;
        if (notes != null ? !notes.equals(movie.notes) : movie.notes != null) return false;
        if (plotoutline != null ? !plotoutline.equals(movie.plotoutline) : movie.plotoutline != null) return false;
        if (plots != null ? !plots.equals(movie.plots) : movie.plots != null) return false;
        if (producer != null ? !producer.equals(movie.producer) : movie.producer != null) return false;
        if (rating != null ? !rating.equals(movie.rating) : movie.rating != null) return false;
        if (subtitles != null ? !subtitles.equals(movie.subtitles) : movie.subtitles != null) return false;
        if (taglines != null ? !taglines.equals(movie.taglines) : movie.taglines != null) return false;
        if (text_languages != null ? !text_languages.equals(movie.text_languages) : movie.text_languages != null)
            return false;
        if (trailer != null ? !trailer.equals(movie.trailer) : movie.trailer != null) return false;
        if (video != null ? !video.equals(movie.video) : movie.video != null) return false;
        if (writer != null ? !writer.equals(movie.writer) : movie.writer != null) return false;
        if (!year.equals(movie.year)) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = name.hashCode();
        result = 31 * result + year.hashCode();
        return result;
    }
}


